﻿<div id="footer" class="container_16 clearfix">
    <div id="footer_top">
        <div class="grid_3 suffix_1">
            <div class="footer_top_text">Product Search</div>
            <ul>
                <li>
                    <a  style="cursor:pointer" onclick="javascript:SearchProductByKey('Pupular Search');">Pupular Search</a>
                </li>                
                <li>
                    <a  style="cursor:pointer" onclick="javascript:SearchProductByKey('Discount Products');">Discount Products</a>
                </li>
                <li>
                    <a  style="cursor:pointer" onclick="javascript:SearchProductByKey('Special Offer');">Special Offer</a>
                </li>
            </ul>                    
        </div>
        <div class="grid_3 suffix_1">
            <div class="footer_top_text">Quick links</div>
            <ul>
                <li><a href="/About-Us" title="About Us">About Us</a></li>
                <li><a href="/Our-Services" title="Our Services">Our Services</a></li>
                <li><a href="/FAQ" title="FAQ">FAQ</a></li>                
            </ul>
        </div>
        <div class="grid_3 suffix_1">
            <div class="footer_top_text">Useful links</div>
            <ul>
                @if (SessionCache.CurrentUser != null && SessionCache.CurrentUser.Company != null)
                {
                    <li>@Html.PublicLink("Log Off", "LogOff", "Account")</li>
                }
                else
                {
                    <li>@Html.PublicLink("Log On", "LogOn", "Account")</li>                    
                }
                <li><a href="/Feedback" title="Send Your Feedback to us">Write to Us</a></li>
            </ul>
		</div>
        <div class="grid_4">
            <div class="footer_top_text">social connectivity</div>
            <div id="footer_top_image">
                <img src="/Content/Images/facebook_icon.png" alt="Facebook" title="Facebook" />
                <img src="/Content/Images/twitter_icon.png" alt="Twitter" title="Twitter" />
                <img src="/Content/Images/flickr_icon.png" alt="Flickr" title="Flickr"/>
            </div>
        </div>
    </div>
    @*<form id="frmNewsLetter" method=post>*@
    <div id="footer_middle">
		<div id="footer_middle_part1" class="grid_5">
            <div class="grid_2 prefix_1">
                <div id="footer_middle_text">Get Started Now</div>
            </div>
            <div class="grid_2">
                <div id="footer_middle_button">
                    <a title="Sign up"  style="cursor:pointer" onclick="javascript:SignUp();"><em></em><span>Sign Up</span><b></b></a>
                </div>
            </div>
        </div>
        <div id="footer_middle_part2" class="grid_10 prefix_1">            
            <div class="grid_2 prefix_1">
                <div id="footer_middle_text">Newsletter</div>
            </div>
            <div class="grid_4">
                @*<input id="footer_middle_searchbox" name="" type="text" />*@
                <input type="text" id="footer_middle_searchbox" name="" value="ENTER YOUR EMAIL" 
                    onfocus="if (this.value == 'ENTER YOUR EMAIL') this.value = '';" 
                    onblur="if (this.value.trim() == '') this.value = 'ENTER YOUR EMAIL';" />
            </div>
            <div class="grid_2">
                <div id="footer_middle_button">
                    <a title="Submit" style="cursor:pointer"  
                        onclick="javascript:AddRemoveNewsLetter();">
                        <em></em><span>Subscribe</span><b></b>
                    </a>
                </div>
            </div>            
        </div>
	</div>
    @*</form>*@
    <div id="footer_bottom">
        <div class="grid_5 suffix_9">
            <div id="footer_bottom_text">
                copyright@bdmarket24.com.all rights reserved
                @if (SessionCache.CurrentUser != null && SessionCache.CurrentUser.GroupID != null)
                {
                    <div>User Type: @UserInfo.GetUserType()</div>
                }
                else
                {
                    <div>User Type: Visitor</div>
                }   
             </div>
        </div>
        <div class="grid_2">
            <div id="footer_bottom_logo"><img src="/Content/Images/logo_bottom.png" alt="BdMarket Logo" title="BdMarket Logo"/></div>
        </div>
    </div>            
</div>

<div class="bm-dialog"  id="divMessageBox" style="display:none">
    <div>            
        <div class="bm-dialog-title">Newsletter Subscription</div>
    </div>
    <div class="bm-dialog-body" style="min-height:60px;" id="dvMsg">
                             
    </div>
    <div class="bm-dialog-button" style="height:15px;"></div>
</div>


<script language="javascript" type="text/javascript">

    function SearchProductByKey(sKey) {        
        window.location.href = "/Product/Search?Key=" + sKey + "";
    }
    function SignUp() {        
        window.location.href = "/Company/Registration";
    }

    function AddRemoveNewsLetter() {

        if ($('#footer_middle_searchbox').val() != 'ENTER YOUR EMAIL') {
            if (isValidEmailAddress($('#footer_middle_searchbox').val())) {
                var url = '@Url.Action("AddRemoveNewsLetter", "Product", new { area = AppConstants.Area.PUBLIC })';
                Ajax(url, 'email=' + $('#footer_middle_searchbox').val(), function (isAdded) {
                    if (isAdded) {
                        ShowDialogMessage('You subscribe the newsletter successfully');
                    }
                    else
                        ShowDialogMessage('You already subscribed the news letter');                    
                }
                );
            }
            else                
                ShowDialogMessage('Given email id is not valid');
            
        }
        else
            ShowDialogMessage('Please insert a valid email address');
    }

    function ShowDialogMessage(Message) {
        var $msgDiv = $('#dvMsg');
        $msgDiv.show().html(Message);

        var $messageDiv = $('#divMessageBox');
        $messageDiv.show();
        setTimeout(function () { $messageDiv.hide(); }, 3000);
    }

    function isValidEmailAddress(emailAddress) 
    {
        var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
        return pattern.test(emailAddress);

    }
        

</script>
            
            
            
            
        